<?php
header("Content-Type: text/html; charset=utf-8");
include_once 'link.php';

$action=$_GET['action'];
if($action=="add"){
	$link_name=$_POST["linkName"];
	$linke_url=$_POST["linkUrl"];
	$link_method=$_POST["linkMethod"];
	$link_picture=$_POST["linkPicture"];
	$id=intval($_POST["proId"]);
	$ret=link_add(  $link_name, $linke_url, $link_method, $link_picture) ;
	
	if($ret!=true){
		echo "<script>alert('新增失败！');</script>";	
	}else{
		echo "<script>alert('新增成功！');</script>";	
	}
	echo ("<script>document.location='linkCatalog.php';</script>");	
} 
 

?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>友情链接新增</title>
<link rel="stylesheet" type="text/css" href="../skin/css/base.css">
<style type="text/css">
.catLog{margin: 20px; padding-top:5px;}
.catLog select { width:300px; }
.catLog input.txtInput{width:300px; }
.catLog input.btSubmit{ margin-left:170px; margin-top:6px;}
</style>
</head>
<body leftmargin="8" topmargin="8" background='../skin/images/allbg.gif'>
<form action="linkAdd.php?action=add" method="post">
<div class="catLog" >
	  链接名称:&nbsp;<input id="linkName" name="linkName"  class="txtInput"  /><br />
	  链接Url:&nbsp;&nbsp;&nbsp;&nbsp;<input id="linkUrl" name="linkUrl"  class="txtInput"  /><br />
	  链接方法:&nbsp;<input id="linkMethod" name="linkMethod"  class="txtInput"   /><br />
	  链接图片:&nbsp;<input id="linkPicture" name="linkPicture"  class="txtInput"   
	/><br />
<input type="submit" class="btSubmit" value="提交" /> <br />
 
</div>
</form>
</body>
</html>
